<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Phar Signature format</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="phar.fileformat.manifestfile.html">Phar manifest file entry definition</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="class.phar.html">Phar</a></div>
 <div class="up"><a href="phar.fileformat.html">What makes a phar a phar and not a tar or a zip?</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="phar.fileformat.signature" class="section">
 <h2 class="title">Phar Signature format</h2>
 <p class="para">
  Phars containing a signature always have the signature appended to the
  end of the Phar archive after the loader, manifest, and file contents.
  The two signature formats supported at this time are MD5 and SHA1.
 </p>
 <p class="para">
  <table class="doctable table">
   <caption><strong>Signature format</strong></caption>
   
    <thead>
     <tr>
      <th>Length in bytes</th>
      <th>Description</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>16 or 20 bytes</td>
      <td>
       The actual signature, 20 bytes for an SHA1 signature,
       16 bytes for an MD5 signature, 32 bytes for an SHA256 signature,
       and 64 bytes for an SHA512 signature.
      </td>
     </tr>

     <tr>
      <td>4 bytes</td>
      <td>
       Signature flags.  <em>0x0001</em> is used to
       define an MD5 signature, <em>0x0002</em> is used
       to define an SHA1 signature, <em>0x0004</em> is used
       to define an SHA256 signature, and <em>0x0008</em> is
       used to define an SHA512 signature.  The SHA256 and SHA512 signature
       support was introduced with API version 1.1.0.
      </td>
     </tr>

     <tr>
      <td>4 bytes</td>
      <td>
       Magic <em>GBMB</em> used to define the presence of a signature.
      </td>
     </tr>

    </tbody>
   
  </table>

 </p>
</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="phar.fileformat.manifestfile.html">Phar manifest file entry definition</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="class.phar.html">Phar</a></div>
 <div class="up"><a href="phar.fileformat.html">What makes a phar a phar and not a tar or a zip?</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
